package br.com.betioli.jme.games.sokobob.layer;

import br.com.betioli.jme.games.sokobob.config.GameConfig;
import javax.microedition.lcdui.game.TiledLayer;

public class TargetLayer extends TiledLayer {
    
    public TargetLayer(char[][] level){
        super(GameConfig.COLUMNS, GameConfig.ROWS, GameConfig.IMAGES, GameConfig.TILE_WIDTH, GameConfig.TILE_HEIGHT);

        for (int r = 0; r < GameConfig.ROWS; r++) {
            for (int c = 0; c < GameConfig.COLUMNS; c++) {
                if( (level[c][r] == GameConfig.TARGET_REF) || 
                    (level[c][r] == GameConfig.BOB_IN_TARGET_REF) ||
                    (level[c][r] == GameConfig.BOX_IN_TARGET_REF) )
                setCell(c, r, GameConfig.TARGET_TILE_INDEX );
            }
        }
    }

}
